/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved.
 */

package com.huawei.housekeeper.common.enums;

import com.huawei.housekeeper.common.constant.BaseCode;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

/**
 * 状态码枚举类
 *
 * @author y84241604
 * @since 2021-11-30
 */
@SuppressFBWarnings({"EI_EXPOSE_REP","EI_EXPOSE_REP2"})
public enum ErrorCode implements BaseCode {
    FORBIDDEN(110001, "没有权限"),

    BUSINESS(110002, "业务异常"),

    UNKNOWN(110003, "未知异常"),

    PARAM_INVALID(110004, "参数非法"),

    USERNAME_OR_PASSWORD_ERROR(110005, "用户名或者密码错误"),

    TOKEN_EXPIRED(110006, "token过期"),

    TOKEN_ERROR(110007, "token错误"),

    IS_EMPTY(110008, "参数为空"),

    JSON_EXECPTION(110009, "json异常"),

    NULL_POINTTER(110010, "空指针异常"),

    ROUTING_ERROR(110011, "路由失败"),
    UPLOAD_FILE_ERROR(140010,"上传失败"),
    UPLOAD_FILE_TYPE_ERROR(140011,"上传文件格式错误");

    private int code;

    private String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }


    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}